//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<ITask.h>
///	@path	~/src/console/
///	@date	2007/06/26
///	@desc	Task interface.

#pragma once

#include "xeres.h"

#include "object/IObject.h"

namespace xeres {

	/*!
		\class	ITask
		\brief	Generic console task interface.
				A task is an encapsulation with a 'RunTask' call,
				which will be called when task is ready to be executed.
				Derived tasks can be collected by Task Manager or Task Queue to run.
	*/
	class ITask : public IObject
	{
	public:

		/// \ctor
		ITask( void );

		/// \dtor
		virtual ~ITask( void );

		DECL_IOBJECT_INTERFACE( ITask , IObject );

		// interface

		// query task name
		virtual WString GetName( void ) = 0;

		// run task
		virtual void RunTask( void ) = 0;

		// on retire task
		virtual void OnRetired( void ) = 0;

	};

} // namespace xeres
